<?php
/**
 * Created by PhpStorm.
 * User: Lee
 * Date: 2019/12/18
 * Time: 14:59
 */
namespace App\Repositories\System;
use App\Common\Utils\BaseRepository;
use App\Models\DictionaryItem;

/**
 * 老项目字典管理 (仓库)
 */
class DictionaryItemRepository extends BaseRepository
{
    protected $model;

    public function __construct(DictionaryItem $dictionaryItem)
    {
        $this->model = $dictionaryItem;
    }

    /**
     * @Description: 通过[id]获取字段数据
     * @Author: kzj
     * @datetime: 2023-03-01
     */
    public function getDictionaryItem(Array $ids)
    {
        $result = $this->model->select('item_order as order','id as optionId','parent_id as parentId','item_value as selectKey','item_name as selectValue')
            ->whereIn('id', $ids)
            ->get();

        return $result;
    }
}
